/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package sp.panelcomponent;

import java.awt.CardLayout;
import java.awt.Color;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextArea;
import sp.controller.QuestControllerTest;
import sp.form.*;
import sp.util.CardLayoutController;

/**
 *
 * @author Tiara Ratna Dewi [12.7403]
 */
public class EntryFormQuestTest extends javax.swing.JPanel {

    private QuestControllerTest controller;
    private CardLayoutController clc;

    /**
     * Creates new form EntryFormQuestTest
     */
    public EntryFormQuestTest() {
        initComponents();
//        setWarnaButton(h1);
//        setWarnaButton(h2);
//        setWarnaButton(h3);
//        setWarnaButton(h4);
//        setWarnaButton(h5);
//        setWarnaButton(h6);
//        setWarnaButton(h7);
        setActive(h1);
        setInactive(h2, h3, h4, h5, h6,h7);
        h1.setBackground(new Color(45,79,123));
        h2.setBackground(new Color(45,79,123));
        h3.setBackground(new Color(45,79,123));
        h4.setBackground(new Color(45,79,123));
        h5.setBackground(new Color(45,79,123));
        h6.setBackground(new Color(45,79,123));
        h7.setBackground(new Color(45,79,123));
        
        setCardManager();
        controller = new QuestControllerTest(this, nextBtn, getBackBtn(), getCloseBtn(), getSaveBtn(), getUpdateBtn(), MainPanel);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        bgquest1 = new sp.background.Bgquest();
        jScrollPane7 = new javax.swing.JScrollPane();
        errDesc = new javax.swing.JTextArea();
        errorTable1 = new sp.panelcomponent.ErrorTable();
        errField = new javax.swing.JLabel();
        h1 = new javax.swing.JButton();
        h2 = new javax.swing.JButton();
        h3 = new javax.swing.JButton();
        h4 = new javax.swing.JButton();
        h5 = new javax.swing.JButton();
        h6 = new javax.swing.JButton();
        MainPanel = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        hal11 = new sp.form.Hal1();
        jScrollPane2 = new javax.swing.JScrollPane();
        hal21 = new sp.form.Hal2();
        jScrollPane3 = new javax.swing.JScrollPane();
        hal31 = new sp.form.Hal3();
        jScrollPane4 = new javax.swing.JScrollPane();
        hal41 = new sp.form.Hal4();
        jScrollPane5 = new javax.swing.JScrollPane();
        hal51 = new sp.form.Hal5();
        jScrollPane6 = new javax.swing.JScrollPane();
        hal61 = new sp.form.Hal6();
        jScrollPane8 = new javax.swing.JScrollPane();
        hal71 = new sp.form.Hal7();
        backBtn = new sp.componentButton.BackminButton();
        nextBtn = new sp.componentButton.NextButton();
        saveBtn = new sp.componentButton.Savebutton();
        closeBtn = new sp.componentButton.Closebutton();
        minimizebutton1 = new sp.componentButton.Minimizebutton();
        closeminbutton1 = new sp.componentButton.Closeminbutton();
        updateBtn = new sp.componentButton.Updatebutton1();
        h7 = new javax.swing.JButton();

        errDesc.setColumns(20);
        errDesc.setRows(5);
        jScrollPane7.setViewportView(errDesc);

        errField.setFont(new java.awt.Font("abeatbyKai", 0, 18)); // NOI18N
        errField.setText("Error");

        h1.setFont(new java.awt.Font("abeatbyKai", 0, 11)); // NOI18N
        h1.setForeground(new java.awt.Color(51, 255, 255));
        h1.setText("Hal1");

        h2.setFont(new java.awt.Font("abeatbyKai", 0, 11)); // NOI18N
        h2.setForeground(new java.awt.Color(51, 255, 255));
        h2.setText("Hal2");

        h3.setFont(new java.awt.Font("abeatbyKai", 0, 11)); // NOI18N
        h3.setForeground(new java.awt.Color(51, 255, 255));
        h3.setText("Hal3");

        h4.setFont(new java.awt.Font("abeatbyKai", 0, 11)); // NOI18N
        h4.setForeground(new java.awt.Color(51, 255, 255));
        h4.setText("Hal4");

        h5.setFont(new java.awt.Font("abeatbyKai", 0, 11)); // NOI18N
        h5.setForeground(new java.awt.Color(51, 255, 255));
        h5.setText("Hal5");

        h6.setFont(new java.awt.Font("abeatbyKai", 0, 11)); // NOI18N
        h6.setForeground(new java.awt.Color(51, 255, 255));
        h6.setText("Hal6");

        MainPanel.setLayout(new java.awt.CardLayout());

        jScrollPane1.setViewportView(hal11);

        MainPanel.add(jScrollPane1, "hal1");

        jScrollPane2.setViewportView(hal21);

        MainPanel.add(jScrollPane2, "hal2");

        jScrollPane3.setViewportView(hal31);

        MainPanel.add(jScrollPane3, "hal3");

        jScrollPane4.setViewportView(hal41);

        MainPanel.add(jScrollPane4, "hal4");

        jScrollPane5.setViewportView(hal51);

        MainPanel.add(jScrollPane5, "hal5");

        jScrollPane6.setViewportView(hal61);

        MainPanel.add(jScrollPane6, "hal6");

        jScrollPane8.setViewportView(hal71);

        MainPanel.add(jScrollPane8, "hal7");

        backBtn.setText("");

        nextBtn.setText("");

        saveBtn.setText("");

        closeBtn.setText("");

        minimizebutton1.setText("");

        closeminbutton1.setText("");

        updateBtn.setText("");

        h7.setFont(new java.awt.Font("abeatbyKai", 0, 11)); // NOI18N
        h7.setForeground(new java.awt.Color(51, 255, 255));
        h7.setText("Hal7");

        javax.swing.GroupLayout bgquest1Layout = new javax.swing.GroupLayout(bgquest1);
        bgquest1.setLayout(bgquest1Layout);
        bgquest1Layout.setHorizontalGroup(
            bgquest1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(bgquest1Layout.createSequentialGroup()
                .addGap(34, 34, 34)
                .addGroup(bgquest1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(errField)
                    .addGroup(bgquest1Layout.createSequentialGroup()
                        .addComponent(errorTable1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(50, 50, 50)
                        .addGroup(bgquest1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(h1)
                            .addComponent(h2)
                            .addComponent(h3)
                            .addComponent(h4)
                            .addComponent(h5)
                            .addComponent(h6)
                            .addComponent(h7)))
                    .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 215, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(31, 31, 31)
                .addGroup(bgquest1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(bgquest1Layout.createSequentialGroup()
                        .addComponent(backBtn, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(nextBtn, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 466, Short.MAX_VALUE)
                        .addComponent(updateBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(saveBtn, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(closeBtn, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(36, 36, 36))
                    .addGroup(bgquest1Layout.createSequentialGroup()
                        .addComponent(MainPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 946, Short.MAX_VALUE)
                        .addGap(23, 23, 23))))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, bgquest1Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(minimizebutton1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(closeminbutton1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        bgquest1Layout.setVerticalGroup(
            bgquest1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(bgquest1Layout.createSequentialGroup()
                .addGroup(bgquest1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(bgquest1Layout.createSequentialGroup()
                        .addGap(230, 230, 230)
                        .addComponent(h1)
                        .addGap(18, 18, 18)
                        .addComponent(h2)
                        .addGap(18, 18, 18)
                        .addComponent(h3)
                        .addGap(18, 18, 18)
                        .addComponent(h4)
                        .addGap(18, 18, 18)
                        .addComponent(h5)
                        .addGap(18, 18, 18)
                        .addComponent(h6)
                        .addGap(18, 18, 18)
                        .addComponent(h7)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(bgquest1Layout.createSequentialGroup()
                        .addGroup(bgquest1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(minimizebutton1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(closeminbutton1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 79, Short.MAX_VALUE)
                        .addComponent(MainPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 567, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(13, 13, 13)))
                .addGap(13, 13, 13)
                .addGroup(bgquest1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(backBtn, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(nextBtn, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(bgquest1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(updateBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(saveBtn, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(bgquest1Layout.createSequentialGroup()
                        .addComponent(closeBtn, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(4, 4, 4)))
                .addContainerGap())
            .addGroup(bgquest1Layout.createSequentialGroup()
                .addContainerGap(244, Short.MAX_VALUE)
                .addComponent(errorTable1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(errField)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 138, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(59, 59, 59))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(bgquest1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 10, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(bgquest1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 22, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

    public void setActive(JButton hal) {
        hal.setForeground(new Color(217, 226, 233));
    }

    public void setInactive(JButton x, JButton y, JButton z, JButton w, JButton v, JButton u) {
        x.setForeground(new Color(44, 62, 80));
        y.setForeground(new Color(44, 62, 80));
        z.setForeground(new Color(44, 62, 80));
        w.setForeground(new Color(44, 62, 80));
        v.setForeground(new Color(44, 62, 80));
        u.setForeground(new Color(44, 62, 80));
    }

    public void setWarnaButton(JButton hal){
        hal.setForeground(new Color(217, 226, 233));
        hal.setBackground(new Color(45,79,123));
    }
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel MainPanel;
    private sp.componentButton.BackminButton backBtn;
    private sp.background.Bgquest bgquest1;
    private sp.componentButton.Closebutton closeBtn;
    private sp.componentButton.Closeminbutton closeminbutton1;
    private javax.swing.JTextArea errDesc;
    private javax.swing.JLabel errField;
    private sp.panelcomponent.ErrorTable errorTable1;
    private javax.swing.JButton h1;
    private javax.swing.JButton h2;
    private javax.swing.JButton h3;
    private javax.swing.JButton h4;
    private javax.swing.JButton h5;
    private javax.swing.JButton h6;
    private javax.swing.JButton h7;
    private sp.form.Hal1 hal11;
    private sp.form.Hal2 hal21;
    private sp.form.Hal3 hal31;
    private sp.form.Hal4 hal41;
    private sp.form.Hal5 hal51;
    private sp.form.Hal6 hal61;
    private sp.form.Hal7 hal71;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JScrollPane jScrollPane7;
    private javax.swing.JScrollPane jScrollPane8;
    private sp.componentButton.Minimizebutton minimizebutton1;
    private sp.componentButton.NextButton nextBtn;
    private sp.componentButton.Savebutton saveBtn;
    private sp.componentButton.Updatebutton1 updateBtn;
    // End of variables declaration//GEN-END:variables

    /**
     * @return the h1
     */
    public javax.swing.JButton getH1() {
        return h1;
    }

    /**
     * @return the h2
     */
    public javax.swing.JButton getH2() {
        return h2;
    }

    /**
     * @return the h3
     */
    public javax.swing.JButton getH3() {
        return h3;
    }

    /**
     * @return the h4
     */
    public javax.swing.JButton getH4() {
        return h4;
    }

    /**
     * @return the h5
     */
    public javax.swing.JButton getH5() {
        return h5;
    }

    /**
     * @return the h6
     */
    public javax.swing.JButton getH6() {
        return h6;
    }

    /**
     * @return the backBtn
     */
    public sp.componentButton.BackminButton getBackBtn() {
        return backBtn;
    }

    /**
     * @return the closeBtn
     */
    public sp.componentButton.Closebutton getCloseBtn() {
        return closeBtn;
    }

    /**
     * @return the saveBtn
     */
    public sp.componentButton.Savebutton getSaveBtn() {
        return saveBtn;
    }

    /**
     * @return the closeminbutton1
     */
    public sp.componentButton.Closeminbutton getCloseminbutton1() {
        return closeminbutton1;
    }

    /**
     * @return the minimizebutton1
     */
    public sp.componentButton.Minimizebutton getMinimizebutton1() {
        return minimizebutton1;
    }

    public ErrorTable getErrorTable1() {
        return errorTable1;
    }

    public JPanel getMainPanel() {
        return MainPanel;
    }

    public Hal1 getHal11() {
        return hal11;
    }

    public Hal2 getHal21() {
        return hal21;
    }

    public Hal3 getHal31() {
        return hal31;
    }

    public Hal4 getHal41() {
        return hal41;
    }

    public Hal5 getHal51() {
        return hal51;
    }

    public Hal6 getHal61() {
        return hal61;
    }
    
    public Hal7 getHal71() {
        return hal71;
    }

    public QuestControllerTest getController() {
        return controller;
    }

    public void setController(QuestControllerTest controller) {
        this.controller = controller;
    }

    public CardLayoutController getClc() {
        return clc;
    }

    private void setCardManager() {
        clc = new CardLayoutController();
        clc.setParentCard(MainPanel);
        clc.setCardLayout((CardLayout) MainPanel.getLayout());
    }

    public JButton getUpdateBtn() {
        return updateBtn;
    }

    public JTextArea getErrDesc() {
        return errDesc;
    }

    public void setErrDesc(JTextArea errDesc) {
        this.errDesc = errDesc;
    }

    public JLabel getErrField() {
        return errField;
    }

    public void setErrField(JLabel errField) {
        this.errField = errField;
    }

    /**
     * @return the h7
     */
    public javax.swing.JButton getH7() {
        return h7;
    }
    
    
    
    
    
}
